\(\int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx\) [838]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 2 \[ \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx=\text {arccosh}(x) \]

[Out]

arccosh(x)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 2, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {54} \[ \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx=\text {arccosh}(x) \]

[In]

Int[1/(Sqrt[-1 + x]*Sqrt[1 + x]),x]

[Out]

ArcCosh[x]

Rule 54

Int[1/(Sqrt[(a_) + (b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_Symbol] :> Simp[ArcCosh[b*(x/a)]/b, x] /; FreeQ[{a,
 b, c, d}, x] && EqQ[a + c, 0] && EqQ[b - d, 0] && GtQ[a, 0]

Rubi steps \begin{align*} \text {integral}& = \cosh ^{-1}(x) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(18\) vs. \(2(2)=4\).

Time = 0.02 (sec) , antiderivative size = 18, normalized size of antiderivative = 9.00 \[ \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx=2 \text {arctanh}\left (\frac {\sqrt {1+x}}{\sqrt {-1+x}}\right ) \]

[In]

Integrate[1/(Sqrt[-1 + x]*Sqrt[1 + x]),x]

[Out]

2*ArcTanh[Sqrt[1 + x]/Sqrt[-1 + x]]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(30\) vs. \(2(2)=4\).

Time = 0.60 (sec) , antiderivative size = 31, normalized size of antiderivative = 15.50

method result size
default \(\frac {\ln \left (x +\sqrt {x^{2}-1}\right ) \sqrt {\left (-1+x \right ) \left (1+x \right )}}{\sqrt {-1+x}\, \sqrt {1+x}}\) \(31\)

[In]

int(1/(-1+x)^(1/2)/(1+x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

ln(x+(x^2-1)^(1/2))*((-1+x)*(1+x))^(1/2)/(-1+x)^(1/2)/(1+x)^(1/2)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 18 vs. \(2 (2) = 4\).

Time = 0.22 (sec) , antiderivative size = 18, normalized size of antiderivative = 9.00 \[ \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx=-\log \left (\sqrt {x + 1} \sqrt {x - 1} - x\right ) \]

[In]

integrate(1/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="fricas")

[Out]

-log(sqrt(x + 1)*sqrt(x - 1) - x)

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.55 (sec) , antiderivative size = 39, normalized size of antiderivative = 19.50 \[ \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx=\begin {cases} 2 \operatorname {acosh}{\left (\frac {\sqrt {2} \sqrt {x + 1}}{2} \right )} & \text {for}\: \left |{x + 1}\right | > 2 \\- 2 i \operatorname {asin}{\left (\frac {\sqrt {2} \sqrt {x + 1}}{2} \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(1/(-1+x)**(1/2)/(1+x)**(1/2),x)

[Out]

Piecewise((2*acosh(sqrt(2)*sqrt(x + 1)/2), Abs(x + 1) > 2), (-2*I*asin(sqrt(2)*sqrt(x + 1)/2), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 14 vs. \(2 (2) = 4\).

Time = 0.21 (sec) , antiderivative size = 14, normalized size of antiderivative = 7.00 \[ \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx=\log \left (2 \, x + 2 \, \sqrt {x^{2} - 1}\right ) \]

[In]

integrate(1/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="maxima")

[Out]

log(2*x + 2*sqrt(x^2 - 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 16 vs. \(2 (2) = 4\).

Time = 0.28 (sec) , antiderivative size = 16, normalized size of antiderivative = 8.00 \[ \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx=-2 \, \log \left (\sqrt {x + 1} - \sqrt {x - 1}\right ) \]

[In]

integrate(1/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="giac")

[Out]

-2*log(sqrt(x + 1) - sqrt(x - 1))

Mupad [B] (verification not implemented)

Time = 0.98 (sec) , antiderivative size = 2, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx=\mathrm {acosh}\left (x\right ) \]

[In]

int(1/((x - 1)^(1/2)*(x + 1)^(1/2)),x)

[Out]

acosh(x)